<template>
	<sysJk :label="'12.消防应急广播系统组件检查和广播、联动功能测试'" showBack :withoutTop="true" :leftTime="lefttime">
		<template v-slot:content>
			<view class="warp" id="warp" @touchmove.stop="()=>{}">
				<view class="w100" v-if="curnum==0">
					<view class="taskTit">
						{{questions[curnum]}}
					</view>
					<view class="imgview" :style="{height:'calc(100vh - '+tH+'px)'}">
						<image :src="bUrl" style="width:100%;height:100%;position:absolute;top:0;z-index: 0;"></image>
					</view>
					<view class="myCard">
						<view class="cardContent">
							<view class="handleBtn">
								<u-button v-if="examType==1"
									:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'green',color:'#fff',fontSize:'3vh'}"
									@click='explain(0)'>查看解析</u-button>
							</view>
							<view class="btnA">
								<view class="btnArea">
									<u-button
										:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'#1E90FF',color:'#fff',fontSize:'3vh'}"
										@click="senda1()">提交</u-button>
									<u-button @click="reset1()"
										:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'#1E90FF',color:'#fff',fontSize:'3vh'}">重做</u-button>
									<u-button
										:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'#1E90FF',color:'#fff',fontSize:'3vh'}"
										@click="back()">返回</u-button>
								</view>
							</view>


							<!--后补的屏-->
							<view v-if="isan1" id="a1area1" class="openiv" :style="{ left:	a1area1left ,top:a1area1top}"
								@tap="openimgview('12-4',1124)">
								<image class="openi" :src="openimg"></image>
							</view>

							<view v-if="isan1" id="a1area2" class="openiv" :style="{ left:	a1area2left ,top:a1area2top}"
								@tap="">
								<image class="openi" :src="openimg"></image>
							</view>
							<view v-if="isan1" id="a1area3" class="openiv" :style="{ left:	a1area3left ,top:a1area3top}"
								@tap="openimgview('12-2',122)">
								<image class="openi" :src="openimg"></image>
							</view>


							<view v-if="isan1122" id="a1a1221" class="openiv rem3"
								:style="{ left:	a1a1221left ,top:a1a1221top,width:a1a1221w,height:a1a1221h,fontSize:'0.4rem'}">
								<view>日期{{date}}</view>
								<view>时间{{dtimetxt}}</view>
								<view>系统运行正常</view>
							</view>

							<view v-if="isan1122" id="a1a12224" class="openiv  "
								:style="{ left:	a1a1222left ,top:a1a1222top,width:a1a1222w ,height:a1a1222h }"
								@tap="playfire()">
							</view>

							<view v-if="isgreen && isan1122" id="a1a12223" class="openiv  "
								:style="{ left:	a1a1223i1l ,top:a1a1223i1t,width:a1a1223i1w ,height:a1a1223i1h }">
								<image class="openi openiv" :src="greenimg"
									:style="{ left:	a1a1223i1l ,top:a1a1223i1t,width:a1a1223i1w ,height:a1a1223i1h }">
								</image>
							</view>

							<view v-if="isgreen && isan1122" id="a1a12223" class="openiv   "
								:style="{ left:	rsl ,top:rst,width:rsw ,height:rsh,color:'#000' }">
								{{"00:00"}}
							</view>



							<view v-if="isan1122" id="a1a12222" class="openiv  "
								:style="{ left:	a1a12abtnl ,top:a1a12abtnt,width:a1a12abtnw ,height:a1a12abtnh }"
								@tap="areaclick()">
							</view>

							<view v-if="isred && isan1122" id="a1a12221" class="openiv  "
								:style="{ left:	a1a1223i2l ,top:a1a1223i2t,width:a1a1223i2W ,height:a1a1223i2h }">
								<image class="openi openiv" :src="redimg"
									:style="{ left:	a1a1223i2l ,top:a1a1223i2t,width:a1a1223i2W ,height:a1a1223i2h }">
								</image>
							</view>

							<view v-if="isan1122" id="a1a1223" class="openiv"
								:style="{ left:	a1a1223left ,top:a1a1223top}" @tap="openimgview('12-1',121 )">
								<image class="openi" :src="closeimg"></image>
							</view>

							<view v-if="isa1124" id="a1a1223" class="openiv" :style="{ left:	a2124cleft ,top:a2124ctop}"
								@tap="openimgview('12-1',121 )">
								<image class="openi" :src="closeimg"></image>
							</view>




							<u-mask :show="showFlag">
								<view class="wrapper"
									style="display: flex;align-items: center;justify-content: center;height:100%">
									<view class="block"
										style="width:200rpx;height:220rpx;background: #fff;color:#000;font-size: 1.5vh;">
										<view style="position: relative;height: 0;top: 0;right: -180rpx;">
											<image @click="onClickHide" class="openi" :src="closeimg"></image>
										</view>
										<view style="padding: 10rpx;" v-if="iscreen2!=0">
											<view><text class="rtext">首警</text>
												{{stime1}}
												手报火警
											</view>
											<view>{{stime1}}感烟探测器火警</view>
											<view> {{stime1}}感烟探测器已反馈</view>
										</view>
									</view>
								</view>
							</u-mask>

							<view v-if="isa1124" id="a1a122f6" class="openiv ds" :style="{ left:	a212tl ,top:a212tt }">
								{{time}}
							</view>

							<view v-if="isa1124" id="areaf2" class="openiv redbg"
								:style="{ left:f2left,top:f2top,width:f2w,height:f2h}" @tap="f2()">

							</view>

							<view v-if="isa1124" id="areaf6" class="openiv redbg"
								:style="{ left:f6left,top:f6top,width:f6w,height:f6h}" @tap="f6()">
							</view>


							<view v-if="isa1124" id="a1a1223i" class="openiv rem7"
								:style="{ left:	a2124il ,top:a2124ih}">
								<view class="flexcol">
									<view v-if="iscreen==0" :style="{ width:stw,height:sth,color:'#000'}"></view>
									<view v-if="iscreen==1" :style="{ width:stw,height:sth,color:'#fff'}">火警信息</view>
									<view v-if="iscreen==2" :style="{ width:stw,height:sth,color:'#fff'}">启动信息</view>
									<view v-if="iscreen==3" :style="{ width:stw,height:sth,color:'#fff'}">反馈信息</view>


									<view class="flexrow">

										<view v-if="iscreen==0"
											:style="{ width:siw,height:sbw,color:'#000',lineHeight:sbw,textAlign:'center'}">
											正常监控状态</view>
										<view v-if="iscreen==1" :style="{ width:siw,height:sbw,color:'#000'}">
											<view><text class="rtext">首警</text> {{stime1}} 1-1手报火警</view>
											<view>{{stime1}} 1-1感烟探测器火警</view>
										</view>
										<view v-if="iscreen==2" :style="{ width:siw,height:sbw,color:'#000'}"><text>
												{{info}}</text></view>
										<view v-if="iscreen==3" :style="{ width:siw,height:sbw,color:'#000'}"> <text>
												{{info}}</text></view>

										<view class="flexcol" :style="{marginLeft:sleft}">
											<view class="flexcol"
												:style="{ width:sbw,height:sbh,color:'#000',marginTop:'3px'}">
												<view style="line-height: 0.4rem;">
													正常运行
												</view>
												<view style="line-height: 0.4rem;">
													手动允许
												</view>
												<view style="line-height: 0.4rem;">
													自动允许
												</view>
											</view>
											<view
												:style="{marginTop:srtt, width:srtw,height:srth,color:'#fff',textAlign:'center'}"
												t80 w137 h30>
												<view style="line-height: 0.4rem;">{{dfulltxt}}</view>
												<view style="line-height: 0.4rem;">{{dtimetxt}}</view>
											</view>
										</view>
									</view>
									<view v-if="iscreen==0" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1查火警
										F2查启动 F3查故障 F4查监管 F5查屏蔽 F6查反馈
									</view>
									<view v-if="iscreen==1" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1查火警
										F2查启动 F3查故障 F4查监管 F5查屏蔽 F6查反馈
									</view>
									<view v-if="iscreen==2" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1页001 F2上一页 F3下一页
										F6退出
									</view>
									<view v-if="iscreen==3" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1页001 F2上一页 F3下一页
										F6退出
									</view>
								</view>
							</view>

						</view>
					</view>

				</view>


				<view class="w100" v-if="curnum==1">
					<view class="taskTit">
						{{questions[curnum]}}
					</view>
					<view class="imgview" :style="{height:'calc(100vh - '+tH+'px)'}">
						<image :src="bUrl" style="width:100%;height:100%;position:absolute;top:0;z-index: 0;"></image>
					</view>
					<view class="myCard">
						<view class="cardContent">

							<view class="handleBtn">

								<u-button v-if="examType==1" color="green"
									custom-style="width:100rpx;height:30rpx;border-radius:10rpx;margin-right:10px"
									@tap='explain(1)'>查看解析</u-button>
							</view>
							<view v-if="istool" class="toolbox">
								<view class="tc1">工具箱</view>
								<view class="toolitems">
									<view class="toolitem" :class="toolid==1?'bord':''" @click="seltool(1)">
										<view>
											<image class="toolimg" :src="tool1"></image>
										</view>
										<view class="tc">感温探测器</view>
									</view>
									<view class="toolitem" :class="toolid==2?'bord':''" @click="seltool(2)">
										<view>
											<image class="toolimg" :src="tool2"></image>
										</view>
										<view class="tc">感烟探测器</view>
									</view>
									<view class="toolitem" :class="toolid==3?'bord':''" @click="seltool(3)">
										<view>
											<image class="toolimg" :src="tool3"></image>
										</view>
										<view class="tc">消防电话</view>
									</view>

									<view class="toolitem" :class="toolid==5?'bord':''" @click="seltool(5)">
										<view>
											<image class="toolimg" :src="tool5"></image>
										</view>
										<view class="tc"> 照度计</view>
									</view>
									<view class="toolitem" :class="toolid==6?'bord':''" @click="seltool(6)">
										<view>
											<image class="toolimg" :src="tool6"></image>
										</view>
										<view class="tc">风速仪</view>
									</view>
									<view class="toolitem" :class="toolid==7?'bord':''" @click="seltool(7)">
										<view>
											<image class="toolimg" :src="tool7"></image>
										</view>
										<view class="tc">微压计</view>
									</view>

								</view>
								<view @click="toolclick()" class="toolbtn"> 确定</view>
							</view>
							<view class="btnA">
								<view v-if="isarea" class="areas">
									<view class="areasTit">场景选择</view>
									<view :class="curarea==0?'areaitem sitem':'areaitem'" @click="setarea(0)">
										<image class="aimg" :src="area1"></image>消防控制室
									</view>
									<view :class="curarea==1?'areaitem sitem':'areaitem'" @click="setarea(1)">
										<image class="aimg" :src="area2"></image>走廊
									</view>
								</view>
								<view class="btnArea">
									<u-button color="#1E90FF	"
										:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'#1E90FF',color:'#fff',fontSize:'3vh'}"
										@click="senda2()">提交</u-button>
									<u-button color="#1E90FF" @click="reset2()"
										:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'#1E90FF',color:'#fff',fontSize:'3vh'}"
										>重做</u-button>
									<u-button color="#1E90FF"
										:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'#1E90FF',color:'#fff',fontSize:'3vh'}"
										@click="back()">返回</u-button>
								</view>
							</view>


							<view v-if="isa2123" id="a1a1223" class="openiv" :style="{ left:	a2123left ,top:a2123top}"
								@tap="openimgview('12-4',124 )">
								<image class="openi" :src="openimg"></image>
							</view>

							<view v-if="isa2125" id="a1a1223" class="openiv" :style="{ left:	a2125left ,top:a2125top}"
								@tap="openimgview('12-6',126 )">
								<image class="openi" :src="openimg"></image>
							</view>


							<view v-if="isfire && isa2126" id="a1a1223" class="openiv"
								:style="{ left:	a2126redleft ,top:a2126redtop,width:a2126redw,height:a2126redh}">
								<image class="openi  openiv" :src="red" :style="{ width:a2126redw,height:a2126redh}">
								</image>
							</view>
							<view v-if="isa2126" id="a1a1223" class="openiv redbg"
								:style="{left:	a2126bleft ,top:a2126btop,width:a2126bw,height:a2126bh}"
								@tap="playfire1()">

							</view>
							<view v-if="isa2126" id="a1a1223" class="openiv" :style="{ left:	a2126cleft ,top:a2126ctop}"
								@tap="openimgview('12-5',125 )">
								<image class="openi" :src="closeimg"></image>
							</view>

							<view v-if="isa2124" id="a1a1223" class="openiv" :style="{ left:	a2124cleft ,top:a2124ctop}"
								@tap="openimgview('12-3',123 )">
								<image class="openi" :src="closeimg"></image>
							</view>




							<u-mask :show="showFlag">
								<view class="wrapper"
									style="display: flex;align-items: center;justify-content: center;height:100%">
									<view class="block"
										style="width:200rpx;height:220rpx;background: #fff;color:#000;font-size: 1.5vh;">
										<view style="position: relative;height: 0;top: 0;right: -180rpx;">
											<image @click="onClickHide" class="openi" :src="closeimg"></image>
										</view>
										<view style="padding: 10rpx;" v-if="iscreen2!=0">
											<view><text class="rtext">首警</text>
												{{stime1}}
												手报火警
											</view>
											<view>{{stime1}}感烟探测器火警</view>
											<view> {{stime1}}感烟探测器已反馈</view>
										</view>
									</view>
								</view>
							</u-mask>

							<view v-if="isa2124" id="a1a122f6" class="openiv ds" :style="{ left:	a212tl ,top:a212tt }">
								{{time}}
							</view>

							<view v-if="iscreen!=0 && isa2124" id="areaf12" class="openiv "
								:style="{ left:ficonl,top:ficont,width:sciconw,height:sciconh}">
								<image class="openi openiv"
									:style="{ left:ficonl,top:ficont,width:sciconw,height:sciconh}" :src="redbtn">
								</image>
							</view>
							<view v-if="iscreen!=0  && isa2124" id="areaf22" class="openiv "
								:style="{ left:siconl,top:sicont,width:sciconw,height:sciconh}">
								<image class="openi openiv"
									:style="{ left:siconl,top:sicont,width:sciconw,height:sciconh}" :src="redbtn">
								</image>
							</view>
							<view v-if="iscreen!=0   && isa2124" id="areaf32" class="openiv "
								:style="{ left:iiconl,top:iicont,width:sciconw,height:sciconh}">
								<image class="openi openiv"
									:style="{ left:iiconl,top:iicont,width:sciconw,height:sciconh}" :src="redbtn">
								</image>
							</view>


							<view v-if="isa2124" id="a1a122f2" class="openiv"
								:style="{ left:	f2left ,top:f2top,width:f2w,height:f2h}" @tap="f2( )">

							</view>
							<view v-if="isa2124" id="a1a122f6" class="openiv"
								:style="{ left:	f6left ,top:f6top,width:f6w,height:f6h}" @tap="f6()">
							</view>

							<view v-if="isa2124" id="a1a1223i" class="openiv rem7"
								:style="{ left:	a2124il ,top:a2124ih}">
								<view class="flexcol">
									<view v-if="iscreen==0" :style="{ width:stw,height:sth,color:'#000'}"></view>
									<view v-if="iscreen==1" :style="{ width:stw,height:sth,color:'#fff'}">火警信息</view>
									<view v-if="iscreen==2" :style="{ width:stw,height:sth,color:'#fff'}">启动信息</view>
									<view v-if="iscreen==3" :style="{ width:stw,height:sth,color:'#fff'}">反馈信息</view>


									<view class="flexrow">

										<view v-if="iscreen==0"
											:style="{ width:siw,height:sbw,color:'#000',lineHeight:sbw,textAlign:'center'}">
											正常监控状态</view>
										<view v-if="iscreen==1" :style="{ width:siw,height:sbw,color:'#000'}">
											<view><text class="rtext">首警</text> {{stime1}} 1-1手报火警</view>
											<view>{{stime1}} 1-1感烟探测器火警</view>
										</view>
										<view v-if="iscreen==2" :style="{ width:siw,height:sbw,color:'#000'}"><text>
												{{info}}</text></view>
										<view v-if="iscreen==3" :style="{ width:siw,height:sbw,color:'#000'}"> <text>
												{{info}}</text></view>

										<view class="flexcol" :style="{marginLeft:sleft}">
											<view class="flexcol"
												:style="{ width:sbw,height:sbh,color:'#000',marginTop:'3px'}">
												<view style="line-height: 0.4rem;">
													正常运行
												</view>
												<view style="line-height: 0.4rem;">
													手动允许
												</view>
												<view style="line-height: 0.4rem;">
													自动允许
												</view>
											</view>
											<view
												:style="{marginTop:srtt, width:srtw,height:srth,color:'#fff',textAlign:'center'}"
												t80 w137 h30>
												<view style="line-height: 0.4rem;">{{dfulltxt}}</view>
												<view style="line-height: 0.4rem;">{{dtimetxt}}</view>
											</view>
										</view>
									</view>
									<view v-if="iscreen==0" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1查火警
										F2查启动 F3查故障 F4查监管 F5查屏蔽 F6查反馈
									</view>
									<view v-if="iscreen==1" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1查火警
										F2查启动 F3查故障 F4查监管 F5查屏蔽 F6查反馈
									</view>
									<view v-if="iscreen==2" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1页001 F2上一页 F3下一页
										F6退出
									</view>
									<view v-if="iscreen==3" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1页001 F2上一页 F3下一页
										F6退出
									</view>
								</view>
							</view>
						</view>
					</view>


				</view>

				<u-mask :show="isexplain" @click="closeex">
					<view class="wrapper" style="display: flex;align-items: center;justify-content: center;height:100%">
						<view class="block"
							style="width:400rpx;padding: 20rpx;box-sizing:border-box;background: #fff;font-size:2vh">
							<view class="overtitle" style="color: #000;">
								【试题解析】 正确答案
							</view>
							<view class="overtitle" style="color: #000;">
								<text>{{explaintext}}</text>
							</view>
						</view>
					</view>
				</u-mask>


			</view>

		</template>
	</sysJk>

</template>


<script>
	import sysJk from '@/components/sysJk.vue'
	import {
		fzQuestion
	} from '@/globalApi/requestApi.js'
	import {
		formatTime,
		getcurtime,
		screentime
	} from '@/util/index.js'
	export default {
		components: {
			sysJk
		},

		data() {
			const app = getApp();
			const baseUrl = app.globalData.requestUrl;

			return {
				widthBl: 0,
				heightBl: 0,
				lefttime: '300',
				examId: '',
				examType: 1,
				date: '',
				time: '',
				info: '',

				dfulltxt: '',
				dtimetxt: '',
				iscreen: 0, //屏状态  1  正常状态 2火警状态  3 f2 信息  f6退出  4，f6 查反馈  f6 退出   5复位 回到1
				stime1: '',
				base: baseUrl,
				writeBox: null,
				writeBoxLeft: 0,
				writeBoxTop: 0,
				showFlag: false,
				an: 1,
				bUrl: baseUrl + "/static/image/wb/12-1.jpg",
				openimg: baseUrl + "/static/image/open.png",
				closeimg: baseUrl + "/static/image/close.png",
				redbtn: baseUrl + "/static/image/red.png",
				questionsnum: 2, //题目数
				isarea: false,
				area1: baseUrl + "/static/image/wb/12-3.jpg",
				area2: baseUrl + "/static/image/wb/12-5.jpg",
				red: baseUrl + "/static/image/red1.png",
				curnum: 0, //当前题目
				tool1: baseUrl + "/static/image/gw.png", //
				tool2: baseUrl + "/static/image/gy.png", //
				tool3: baseUrl + "/static/image/dh.png", //
				tool4: baseUrl + "/static/image/bs.png", //
				tool5: baseUrl + "/static/image/zm.png", //
				tool6: baseUrl + "/static/image/cf.png", //
				tool7: baseUrl + "/static/image/wyj.png", //
				tool8: baseUrl + "/static/image/cf.png", //

				questions: ['【1/2】请手动启动应急广播并选择广播分区进行广播（广播分区1）',
					'【2/2】请通过联动触发火警信号，启动消防应急广播系统',
				],




				isan1: true,
				a1area1left: 0,
				a1area1top: 0,
				//222
				isa2123: false,
				isa2124: false,
				isa2125: false,
				isa2126: false,

				a1area2left: 0,
				a1area2top: 0,
				a1area3left: 0,
				a1area3top: 0,
				//
				isa1124: false, //后补的第一小题
				isan1122: false,
				a1a1221left: 0,
				a1a1221top: 0,
				a1a1221w: 0,
				a1a1221h: 0,

				isgreen: false,
				isred: false,

				//屏图标宽高
				sciconw: 20,
				sciconh: 20,
				//火警
				ficonl: 649,
				ficont: 137,


				//启动
				siconl: 824,
				sicont: 139,

				//反馈
				iiconl: 824,
				iicont: 289,



				greenimg: baseUrl + "/static/image/green.png",
				redimg: baseUrl + "/static/image/red.png",



				a1a1222left: 0,
				a1a1222top: 0,
				a1a1222w: 0, //50
				a1a1222h: 0, //90
				a1a1223left: 0,
				a1a1223top: 0,
				curarea: 0,



				a1a1223i1l: 1059,
				a1a1223i1t: 458,
				a1a1223i1w: 13,
				a1a1223i1h: 13,


				a1a12abtnl: 1117,
				a1a12abtnt: 459,
				a1a12abtnw: 40,
				a1a12abtnh: 40,


				a1a1223i2l: 752,
				a1a1223i2t: 699,
				a1a1223i2W: 12,
				a1a1223i2h: 12,
				////12-3
				a2123left: 680,
				a2123top: 580,

				//12-5
				a2125left: 710,
				a2125top: 640, //12-6

				//16-6
				//red

				a2126redleft: 980,
				a2126redtop: 365,
				a2126redw: 20,
				a2126redh: 20,


				a2126bleft: 996,
				a2126btop: 482,
				a2126bw: 40,
				a2126bh: 40,

				a2126cleft: 1195,
				a2126ctop: 330, //c12 -5

				a2124cleft: 1750,

				isfire: false,
				istoolck: false,

				a2124ctop: 230,
				a2124il: 1130,
				a2124ih: 96,
				a212tl: 410,
				a212tt: 100,




				stw: '479',
				sth: '28',
				sleft: "10",
				siw: '330',
				sih: '200',
				sbw: '146',
				sbh: "68",
				srtw: '138',
				srth: '30',
				srtt: '80',
				sitt: '15',
				s5w: "495",
				s5h: '25',
				//f2
				//f2
				f2left: 1130,
				f2top: 549,
				f2w: 82,
				f2h: 45,

				//f6
				f6left: 1517,
				f6top: 549,
				f6w: 82,
				f6h: 45,

				//redscreen
				rsl: 700,
				rst: 476,
				rsw: 107,
				rsh: 38,

				innerAudioContext: uni.createInnerAudioContext(),
				jb: baseUrl + "/static/image/jb.MP3",
				yy: baseUrl + "/static/image/yy.MP3",
				quest: {
					fz_id: 2,
					title: '',
					no: "",
					question_type: 1,
					user_answer: '',
					answer: '',
					is_correct: '',
					score: '',
					start_time: 0,
					end_time: 0,
					question_answer: ''
				},
				explainarr: ['点应急广播，点1 ',
					'中控主机自动允许，去走廊触发手报和探测器'
				],
				isexplain: false,
				explaintext: '',
				istool: false,
				toolid: 0,
				tH: 0,
				score1: 0,
				score2: 0,

			}
		},
		onLoad(options) {
			let dt = new Date()
			let m = dt.getMonth() + 1
			this.date = dt.getFullYear() + "/" + m + "/" + dt.getDay()
			this.time = dt.getHours() + ":" + dt.getMinutes()
			uni.setScreenBrightness({
				keepScreenOn: true,
				direction: 'landscape',
				success() {
					console.log("a")
				}
			})
			let df = new Date()
			let h1 = df.getHours()
			let m1 = df.getMinutes()
			this.time = h1 + ":" + m1
			this.dfulltxt = df.getFullYear() + "/" + m + df.getDate()
			let that = this
			setInterval(() => {
				let df1 = new Date()
				that.dtimetxt = df1.getHours() + ":" + df1.getMinutes() + ":" + df1.getSeconds()
			}, 1000)




			setInterval(() => {
				that.time = getcurtime()
			}, 20000)
			this.examId = options.examId
			this.examType = options.examType
			var writeBox = uni.createSelectorQuery().in(this).select('.imgview')
			writeBox.boundingClientRect(data => {
				this.writeBox = data
			}).exec()
		},
		onShow() {
			let that = this
			// uni.getSystemInfo({
			// 	success: function(res) {
			// 		console.log(res)
			// 		// uni.setStorageSync('titleHeight',res.statusBarHeight+capsuleH)
			// 		that.tH = uni.getMenuButtonBoundingClientRect().height + uni
			// 			.getMenuButtonBoundingClientRect().top * 2 + 21
			// 		//that.tH=85 
			// 		that.drawWhiteBox()
			// 	}
			// });
		},
		onReady() {
			let that = this;
			// #ifdef MP-WEIXIN
			uni.getSystemInfo({
				success: function(res) {
					console.log(res)
					// uni.setStorageSync('titleHeight',res.statusBarHeight+capsuleH)
					that.tH = uni.getMenuButtonBoundingClientRect().height + uni
						.getMenuButtonBoundingClientRect().top * 2 + 21
					//that.tH=85
					that.drawWhiteBox()
				}
			});
			// #endif

			// #ifdef APP-PLUS
			let sy = uni.getSystemInfoSync()
			this.pT = sy.statusBarHeight
			this.tH = sy.statusBarHeight + 51
			that.drawWhiteBox(this.tH)

			// #endif
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			explain(id) {
				this.isexplain = true;
				this.explaintext = this.explainarr[id]

			},

			f2() {
				console.log("f2")
				if (this.iscreen == 1) {
					this.iscreen = 2 //f2状态 
					this.info = this.stime1 + '排烟风机启动\r\n'
					this.info = this.info + this.stime1 + '排烟口启动'
				}
			},
			f6() {
				//f6状态
				console.log("f6")
				if (this.iscreen == 2) { //	//退出
					this.iscreen = 1
				}
				if (this.iscreen == 1) { //反馈
					this.iscreen = 3
					this.info = this.stime1 + '排烟风机已反馈\r\n'
					this.info = this.info + this.stime1 + '排烟口已反馈'
				}
				if (this.iscreen == 3) { //	//退出
					this.iscreen = 1
				}
			},
			closeex() {
				this.isexplain = false
			},

			areaclick() {
				this.isgreen = !this.isgreen

				if (this.isgreen) {
					this.bUrl = this.base + "/static/image/jk/11-4-4.jpg"
					this.innerAudioContext.src = this.yy;
					this.innerAudioContext.onPlay(() => {
						console.log('开始播放');
					});
					this.innerAudioContext.onError((res) => {
						console.log(res.errMsg);
						console.log(res.errCode);
					});
					console.log(this.innerAudioContext.paused)
					if (this.innerAudioContext.paused == true) {

						console.log("play")

						this.innerAudioContext.play();
					} else {
						console.log("stop")
						this.innerAudioContext.stop();
					}
				} else {
					this.bUrl = this.base + "/static/image/wb/12-2.jpg"
					this.innerAudioContext.stop()
				}

			},
			playfire1() {
				this.isfire = true
				this.iscreen = 1
				this.stime1 = screentime()
				this.innerAudioContext.src = this.jb;
				this.innerAudioContext.onPlay(() => {
					console.log('开始播放');
				});
				this.innerAudioContext.onError((res) => {
					console.log(res.errMsg);
					console.log(res.errCode);
				});
				console.log(this.innerAudioContext.paused)
				if (this.innerAudioContext.paused == true) {

					console.log("play")

					this.innerAudioContext.play();
				} else {
					console.log("stop")
					this.innerAudioContext.stop();
				}
			},
			reset() {
				this.iscreen = 0
				this.isan1 = true
				this.isa1124 = false //后补的第一小题
				this.isan1122 = false
				this.isgreen = false
				this.isred = false
				this.isfire = false
				this.istoolck = false
				this.istool = false
				this.toolid = 0


				this.isa2123 = false
				this.isa2124 = false
				this.isa2125 = false
				this.isa2126 = false

			},
			reset1() {
				this.reset()
				this.innerAudioContext.stop()
				let that = this
				that.curnum = 0
				this.isarea = false
				this.isan1 = true
				this.isredbtn = false
				that.bUrl = that.base + "/static/image/wb/12-1.jpg"


			},
			reset2() {
				this.reset()
				this.innerAudioContext.stop()
				let that = this
				that.curnum = 1
				that.isarea = true
				that.isa2123 = true
				that.bUrl = that.base + "/static/image/wb/12-3.jpg"
				that.setarea(0)
				that.isfire = false
				that.istoolck = false
			},
			senda1() {
				let that = this
				//手动启动广播    【0.5】
				if (that.isredbtn) {
					that.score1 = 0.5
				}
				this.$showModal2({
					title: '确认提交？' + that.score1,
					// content: '这是一个模态弹窗',

				}).then(() => {

					that.curnum = 1
					that.innerAudioContext.stop()

					that.isarea = true
					that.isa2123 = true
					that.curarea = 0
					that.setarea(0)
					that.bUrl = that.base + "/static/image/wb/12-3.jpg"


				});

			},
			senda2() {
				//	控制室自动允许  【1】

				//					触发联动启动      【0.5】
				let that = this
				if (that.isfire && that.istoolck) {
					that.score2 = 1.5
				}
				this.innerAudioContext.stop()
				let ss = that.score1 + that.score2
				this.$showModal2({
					title: '确认提交？' + that.score2,
					// content: '这是一个模态弹窗',

				}).then(() => {
					uni.showLoading()
					fzQuestion(that.quest).then(res => {
						uni.hideLoading()
						let pages = getCurrentPages()
						if(pages.length==4){
							let prevPage = pages[pages.length - 3] 
							prevPage.$vm.status12 = true
							prevPage.$vm.addScore(ss)
							uni.navigateBack()
						}else{
							let prevPage = pages[pages.length - 2]
							prevPage.$vm.status12 = true
							prevPage.$vm.addScore(ss) 
							uni.navigateBack()
						} 
					})

				});

				// uni.showToast({
				// 	title:'提交后不可修改',
				// 	success() {
				// 		setTimeout(()=>{uni.navigateBack()},500)

				// 	}
				// })
				/**
				 * 	12消防应急广播系统组件检查和广播、联动功能测试【2】
									【1/2】请手动启动应急广播并选择广播分区进行广播（广播分区1）
									火灾报警控制器消防联动控制器    -->自动
									【2/2】请通过联动触发火警信号，启动应急广播系统
									手报+烟感
									【三步】
									控制室自动允许  【1】
									手动启动广播    【0.5】
									触发联动启动      【0.5】
									
									score1
									score2
									score3
									score4
									
								
				 * 
*/
			},
			//切换场景
			setarea(id) {
				this.curarea = id
				if (this.curnum == 0) {
					if (id == 0) {
						this.isa2125 = false;
						this.isa2123 = true;
						this.bUrl = this.base + "/static/image/wb/12-3.jpg"
					}
					if (id == 1) {
						this.isa2125 = true;
						this.isa2123 = false;

						this.bUrl = this.base + "/static/image/wb/12-5.jpg"
					}
				}
				if (this.curnum == 1) {
					if (id == 0) {
						this.isa2125 = false;
						this.isa2123 = true;
						this.istool = false
						this.bUrl = this.base + "/static/image/wb/12-3.jpg"
					}
					if (id == 1) {
						this.isa2125 = true;
						this.isa2123 = false;
						this.istool = true
						this.bUrl = this.base + "/static/image/wb/12-5.jpg"
					}
				}
			},
			playfire() {
				this.isredbtn = true
				this.isred = !this.isred

			},
			//打开新的图片
			openimgview(path, lb) {
				this.bUrl = this.base + "/static/image/wb/" + path + ".jpg";
				this.time = getcurtime()
				//关闭场景的开关 
				this.isarea = false
				switch (lb) {
					case 121:
						this.isan1122 = false
						this.isan1 = true
						this.isa1124 = false;
						break
					case 122:
						this.isan1122 = true
						this.isan1 = false
						break;

					case 1124:
						this.isa1124 = true;
						this.isan1 = false
						break;

					case 123:
						this.isa2123 = true
						this.isarea = true
						this.isa2124 = false
						this.istool = false
						break;
					case 124:
						this.isa2124 = true
						this.isan1 = false
						this.isa2123 = false
						break;
					case 125:
						this.isa2125 = true
						this.isarea = true
						this.isa2126 = false
						this.istool = true
						break;
					case 126:
						this.istool = false
						this.isa2126 = true
						this.isa2125 = false

						break;


				}

			},
			seltool(id) {
				console.log("settool")
				this.toolid = id
			},
			toolclick() {
				//要提前下载一下8-5 8-5-1
				console.log("tool")

				//判断选择的工具
				console.log(this.toolid)
				if (this.toolid == 2) {
					this.istoolck = true;
					if (this.isfire) {
						this.iscreen = 1
					}
					//得分
					this.bUrl = this.base + "/static/image/wb/8-5.jpg"
					setTimeout(() => {
						this.bUrl = this.base + "/static/image/wb/8-5-1.jpg"
					}, 500)
					setTimeout(() => {
						this.bUrl = this.base + "/static/image/wb/8-5.jpg"
					}, 1500)
					setTimeout(() => {
						this.bUrl = this.base + "/static/image/wb/8-5-1.jpg"
					}, 2000)
					setTimeout(() => {
						this.bUrl = this.base + "/static/image/wb/8-3.jpg"
						this.innerAudioContext.src = this.yy;
						this.innerAudioContext.onPlay(() => {
							console.log('开始播放');
						});
						this.innerAudioContext.onError((res) => {
							console.log(res.errMsg);
							console.log(res.errCode);
						});
						console.log(this.innerAudioContext.paused)
						if (this.innerAudioContext.paused == true) {

							console.log("play")

							this.innerAudioContext.play();
						} else {
							console.log("stop")
							this.innerAudioContext.stop();
						}
					}, 2500)

				}
			},


			showDialog() {
				this.showFlag = true
			},
			onClickHide() {
				this.showFlag = false
			},
			drawWhiteBox(statusnum) {
				let that = this
				let warp = uni.createSelectorQuery().in(this).select('.imgview')

				warp.boundingClientRect(data => {
					console.log(that.tH)
					console.log(data)
					console.log(data.width)
					console.log(data.height)
					//有些设备取的是设备高度 data.height


					let widthBl = data.width / 1920
					let sy = uni.getSystemInfoSync()
					let heightBl = 0
					heightBl = (data.height - that.tH) / 921

					that.widthBl = widthBl
					that.heightBl = heightBl

					that.a1area1left = 660 * widthBl + 'px'
					that.a1area1top = 490 * heightBl + statusnum + 'px'

					that.a1area2left = 860 * widthBl + 'px'
					that.a1area2top = 490 * heightBl + statusnum + 'px'
					that.a1area3left = 1064 * widthBl + 'px'
					that.a1area3top = 490 * heightBl + statusnum + 'px'



					////

					that.a1a1221left = 1172 * widthBl + 'px'
					that.a1a1221top = 114 * heightBl + statusnum + 'px'

					that.a1a1221w = 165 * widthBl + 'px'
					that.a1a1221h = 100 * heightBl + 'px'

					that.a1a1222left = 736 * widthBl + 'px'
					that.a1a1222top = 740 * heightBl + statusnum + 'px'
					that.a1a1222w = 50 * widthBl + 'px'
					that.a1a1222h = 40 * heightBl + 'px'

					that.a1a1223left = 1600 * widthBl + 'px'
					that.a1a1223top = 100 * heightBl + statusnum + 'px'




					that.a1a1223i1l = 1059 * widthBl + 'px'
					that.a1a1223i1t = 458 * heightBl + statusnum + 'px'
					that.a1a1223i1w = 13 * widthBl + 'px'
					that.a1a1223i1h = 13 * heightBl + 'px'


					that.a1a12abtnl = 1117 * widthBl + 'px'
					that.a1a12abtnt = 459 * heightBl + statusnum + 'px'
					that.a1a12abtnw = 40 * widthBl + 'px'
					that.a1a12abtnh = 40 * heightBl + 'px'


					that.a1a1223i2l = 752 * widthBl + 'px'
					that.a1a1223i2t = 699 * heightBl + statusnum + 'px'
					that.a1a1223i2W = 12 * widthBl + 'px'
					that.a1a1223i2h = 12 * heightBl + 'px'

					////2222222
					//12-3
					that.a2123left = 680 * widthBl + 'px'
					that.a2123top = 490 * heightBl + statusnum + 'px'

					//12-5
					that.a2125left = 710 * widthBl + 'px'
					that.a2125top = 505 * heightBl + statusnum + 'px' //12-6

					//12-6
					//red 
					that.a2126redleft = 980 * widthBl + 'px'
					that.a2126redtop = 365 * heightBl + statusnum + 'px'
					that.a2126redw = 20 * widthBl + 'px'
					that.a2126redh = 20 * heightBl + 'px'


					that.a2126bleft = 996 * widthBl + 'px'
					that.a2126btop = 402 * heightBl + statusnum + 'px'
					that.a2126bw = 40 * widthBl + 'px'
					that.a2126bh = 40 * heightBl + 'px'

					that.a2126cleft = 1195 * widthBl + 'px'
					that.a2126ctop = 270 * heightBl + statusnum + 'px' //c12 -5


					//12-4
					that.a2124cleft = 1750 * widthBl + 'px'
					that.a2124ctop = 170 * heightBl + statusnum + 'px' //c12 -3			
					that.a2124il = 1130 * widthBl + 'px'

					that.a2124ih = 96 * heightBl + statusnum + 'px'



					//时间
					that.a212tl = 410 * widthBl + 'px'
					that.a212tt = 85 * heightBl + statusnum + 'px'
					//标题
					that.stw = 479 * widthBl + 'px'
					that.sth = 28 * heightBl + 'px'
					//中间两部分间隔
					that.sleft = 10 * widthBl + 'px'
					//内容
					that.siw = 340 * widthBl + 'px'
					that.sih = 200 * heightBl + 'px'
					//右边信息
					that.sbw = 146 * widthBl + 'px'
					that.sbh = 77 * heightBl + 'px'
					//右边时间
					that.srtw = 138 * widthBl + 'px'
					that.srth = 30 * heightBl + 'px'
					that.srtt = 90 * heightBl + 'px'
					//底部信息
					that.sitt = 0 * heightBl + 'px'
					that.s5w = 495 * widthBl + 'px'
					that.s5h = 25 * heightBl + 'px'


					//f2
					that.f2left = 1130 * widthBl + 'px'
					that.f2top = 471 * heightBl + statusnum + 'px'
					that.f2w = 82 * widthBl + 'px'
					that.f2h = 45 * heightBl + 'px'

					//f6
					that.f6left = 1517 * widthBl + 'px'
					that.f6top = 471 * heightBl + statusnum + 'px'
					that.f6w = 82 * widthBl + 'px'
					that.f6h = 45 * heightBl + 'px'

					//标题
					that.stw = 479 * widthBl + 'px'
					that.sth = 28 * heightBl + 'px'
					//中间两部分间隔
					that.sleft = 10 * widthBl + 'px'
					//内容
					that.siw = 340 * widthBl + 'px'
					that.sih = 200 * heightBl + 'px'
					//右边信息
					that.sbw = 146 * widthBl + 'px'
					that.sbh = 77 * heightBl + 'px'
					//右边时间
					that.srtw = 138 * widthBl + 'px'
					that.srth = 30 * heightBl + 'px'
					that.srtt = 90 * heightBl + 'px'
					//底部信息
					that.sitt = 0 * heightBl + 'px'
					that.s5w = 495 * widthBl + 'px'
					that.s5h = 25 * heightBl + 'px'

					that.rsl = 700 * widthBl + 'px'
					that.rst = 476 * heightBl + statusnum + 'px'
					that.rsw = 107 * widthBl + 'px'
					that.rsh = 38 * heightBl + 'px'


					//屏图标宽高
					that.sciconw = 20 * widthBl + 'px'
					that.sciconh = 20 * heightBl + 'px'

					//火警
					that.ficonl = 649 * widthBl + 'px'
					that.ficont = 137 * heightBl + statusnum + 'px'


					//启动
					that.siconl = 824 * widthBl + 'px'
					that.sicont = 139 * heightBl + statusnum + 'px'

					//反馈
					that.iiconl = 824 * widthBl + 'px'
					that.iicont = 289 * heightBl + statusnum + 'px'

				}).exec()

				// uni.getSystemInfo({
				// 	success: function(res) {
				// 		console.log(res)
				// 		

				// 	}
				// });
			}
		}
	}
</script>


<style scoped lang="scss">
	.explaincss {
		padding: 20rpx;
		width: 300rpx;

		border-radius: 20rpx;
		border: 1rpx solid #000;
		background-color: #fff;
		color: #000;
		position: fixed;
		top: 50rpx;
		left: 225rpx;
		z-index: 5000;
	}

	.rem7 {
		font-size: 0.4rem;
	}

	.rem3 {
		font-size: 0.3rem;
	}

	.flexcol {
		display: flex;
		flex-direction: column;
	}

	.flexrow {
		display: flex;
	}

	.warp {
		height: 100%;
		box-sizing: border-box;
		// padding: 22rpx 33rpx 38rpx 36rpx;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: center;
		background: #F6F6F6;

		.w100 {
			width: 100%;
			height: 100%;
		}

		.openiv {
			position: fixed;
		}

		.redbg {}

		.openi {
			width: 20px;
			height: 20px;
		}

		.ds {
			color: #DA2627;
			font-family: DS-Digital;
			font-size: 20px;
		}

		.answerview {
			position: fixed;
			top: 80rpx;
			left: 40rpx;
			background-color: #ffffff;
			color: #000;
			width: 200rpx;
			font-size: 2vh;
		}


		.ytitle {
			background-color: #ffb700;
			line-height: 26rpx;
		}

		.ritem {
			line-height: 20rpx;
		}


		.imgview {
			position: relative;
			width: 100%;

		}

		.aimg {
			width: 60rpx;
			height: 35rpx;
		}

		.areas {
			// background-color: rgba(255, 165, 0, 0.2);
			margin-bottom: 10px;

			.areasTit {
				background: orange;
			}

			color: #000;
		}

		.sitem {
			border: 2rpx solid red;
		}

		.areaitem {
			background: #fff;

			display: flex;
			align-items: center;
			justify-content: flex-start;
		}



		#a1area1 {
			position: fixed;
		}

		#a1area2 {
			position: fixed;
		}

		#a1area3 {
			position: fixed;
		}


		#a1a1221 {
			position: fixed;
			color: #000;
			font-size: 10px;
		}

		#a1a1222 {
			position: fixed;
			width: 50px;
			height: 50px;
		}

		#a1a1223 {
			position: fixed;
		}

		.toolimg {
			width: 30rpx;
			height: 30rpx;
		}

		.toolbtn {
			padding: 5rpx 10rpx;
			background: #ffb700;
			border-radius: 5rpx;
			text-align: center;
			width: 50px;
			margin: auto;
		}

		.toolbox {
			position: fixed;
			right: 150rpx;
			top: 60rpx;
			font-size: 12rpx;
			color: #000;
			background: #fff;
			width: 92rpx;
			z-index: 10000;
			border: 1px solid #fff;
		}

		.bord {
			border: 1rpx solid red;
		}


		.toolitems {
			display: flex;
			flex-wrap: wrap;
			width: 92rpx;
			justify-content: space-between;
		}

		.toolitem {
			display: flex;
			flex-direction: column;
			width: 30rpx;
			justify-content: space-between;
		}


		.tc1 {
			text-align: center;
			font-size: 10px;
			background: orange;
			color: #fff;
		}

		.tc {
			display: flex;
			align-items: center;

			text-align: center;
			font-size: 8px;
			justify-content: center;
			align-content: center;
		}

		.taskTit {
			height: 21px;
			line-height: 21px;
			width: 100%;
			text-align: left;
			background: #fff;
			color: #000;
			font-size: 15px
		}

		.myCard {
			width: 100%;
			// height:100%;
			position: relative;
			// border-radius: 20rpx;
			//	overflow: hidden;
			z-index: 1;

			.cardContent {
				// padding: 52rpx 58rpx 37rpx;
				box-sizing: border-box;
				width: 100%;
				height: 100%;
				position: relative;
				z-index: 2;
				color: #fff;

				.moneyContent {
					margin-top: 54rpx;
					width: 100%;
					display: flex;
					align-items: center;

					.moneyDetail {
						width: 50%;
						display: flex;
						flex-direction: column;
						align-items: center;
						justify-content: flex-start;

						.detailTit {
							font-size: 24rpx;
							font-weight: 400;
						}

						.detailVal {
							font-size: 55rpx;
							font-weight: bold;
							margin-top: 35rpx;
						}
					}

				}



				.handleBtn {
					position: fixed;
					left: 30px;
					bottom: 0px;
				}

				.btnA {
					display: flex;
					flex-direction: column;
					position: fixed;
					right: 30px;
					bottom: 0px;
					align-items: flex-end;
				}

				.btnArea {
					//	margin-top: 160rpx;
					//margin-left: 150rpx;
					display: flex;
					justify-content: center;
					///	position:fixed;
					//	right:30px;
					//	bottom:30px
					// text-align: center;
				}
			}
		}

		.infoBox {
			width: 100%;
			padding: 14rpx 30rpx;
			margin-top: 33rpx;
			border-radius: 20rpx;
			box-sizing: border-box;
			background: #fff;

			.singleInfo {
				width: 100%;
				box-sizing: border-box;
				padding: 20rpx 0;
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1rpx solid #ccc;

				.info {
					flex: 1;

					.desc {
						font-size: 26rpx;
						font-weight: 400;
						color: #222222;
					}

					.time {
						margin-top: 15rpx;
						font-size: 18rpx;
						font-weight: 400;
						color: #888888;
						display: flex;
						align-items: center;
					}
				}

				.val {
					width: 115rpx;
					height: 40rpx;
					border: 1rpx solid #DA2627;
					border-radius: 40rpx;
					text-align: center;
					font-size: 22rpx;
					font-weight: 400;
					color: #DA2627;
					line-height: 40rpx;
				}
			}
		}

		.writeBox {
			border: none;
			width: 0px;
			height: 0px;
			position: fixed
		}
	}
</style>